#ifndef QCOMBOBOXITEMDELEGATE_H
#define QCOMBOBOXITEMDELEGATE_H

#include <QItemDelegate>
#include <map>
#include "chelperclass.h"

class QComboBoxItemDelegate : public QItemDelegate
{
    Q_OBJECT

public:
    QComboBoxItemDelegate(QWidget *parent);
    ~QComboBoxItemDelegate();

    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,const QModelIndex &index) const;

    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index) const;

    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setAFont(QFont a_font);
    QFont getAFont(){return m_font;}
    void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index );
    void setKolicinaMusterija(float kolMusterija);
signals:
    void updateMyIcon(int& i);
    void updatePodatoci() const;
private:
    QFont m_font;
private:

    mutable std::map<QString, tArt> artMap; 
    float m_kolMusterija;
    
};

#endif // QCOMBOBOXITEMDELEGATE_H
